package com.itheima;

import com.fix.config.EnableUser;
import com.fix.config.MyImportSelector;
import com.fix.config.UserConfig;
import com.fix.pojo.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@SpringBootApplication
//@ComponentScan(basePackages = "com.fix")
//@Import(UserConfig.class) //导入配置类
//@Import(User.class) //导入对象
//@Import(MyImportSelector.class)
@EnableUser
public class SpringBoot05Application {

	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext = SpringApplication.run(SpringBoot05Application.class, args);
		//Object user = applicationContext.getBean("user");
		//导入对象获取方式
		User user = applicationContext.getBean(User.class);
		System.out.println("user = " + user);
	}

}
